package reflect;

import reflect.annotation.AutoRunClass;

import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) throws Exception{
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入类名");
        Class<?> cla = Class.forName(sc.nextLine());
        if(cla.isAnnotationPresent(AutoRunClass.class)){
            Object obj = cla.newInstance();
            System.out.println(obj);
        }else {
            System.out.println("没有被标注");
        }
    }
}
